import Vue from "./src/index";
import { arrayPrototype } from './src/lib/arrayProxy'
const vm = new Vue({
    data() {
        return {
            a: 23,
            b: [{ ce: 45, t: 'ss' }, 2, 3],
            c: {
                name: 'ju',
                age: 12,
                info: {
                    class: '1班'
                }
            }
        }
    }
})
console.log(vm);
/* var input = {
    'a.b.c.dd': 'abcd',
    'a.d.xx': 'adxx',
    'a.e': 'ae',
    'c.d': 2,
    'c.e.d': 34,
    'f.g': 2333
}
//将对象转化成二维数组
//input==>[['a.b.c.d','abcd],['a.d.xx','adxx],['a.e','ae']]
function changeArray(data: object): Array<any> {
    let newArr: Array<any> = [];
    for (let key in data) {
        newArr.push([key, data[key]])
    }
    return newArr
}

function changeObject(array: Array<any>): object {
    let newObj: object = {};
    for (let j = 0; j < array.length; j++) {
        let beforeObj = newObj;
        let props: Array<string> = array[j][0].split('.');
        let value: any = array[j][1];
        for (let index = 0; index < props.length; index++) {
            let key = props[index];
            if (index != props.length - 1) {
                beforeObj[key] = beforeObj[key] || {};
                beforeObj = beforeObj[key];
            } else {
                beforeObj[key] = value;
            }
        }
    }
    return newObj;
}
let arr: Array<any> = changeArray(input);
let obj: object = changeObject(arr);
console.log(input);
console.log(obj); */
